{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "1b5f521d",
   "metadata": {},
   "outputs": [],
   "source": [
    "from general import *\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0df36417",
   "metadata": {},
   "outputs": [],
   "source": [
    "def deextreme_MAD(fac):\n",
    "    n = 1.483\n",
    "    fac = fac.T\n",
    "    mid = fac.median()\n",
    "    mad = (fac - mid).abs().median()\n",
    "    fac = (fac < mid - n*mad)*(mid - n*mad) + (fac > mid + n*mad)*(mid + n*mad) + ((fac <= mid + n*mad)&(fac >= mid - n*mad))*fac\n",
    "    return fac.T\n",
    "\n",
    "def preprocessing(fac):\n",
    "    dd = pd.read_csv(factor_folder+fac+'.csv',index_col=0)\n",
    "    dd = dd.sort_index().fillna(method='ffill').fillna(0)\n",
    "    dd = deextreme_MAD(dd)\n",
    "    return dd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "dcf078ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "names = \"SIZE,BP,NonLinerSize,BETA,HSIGMA,STOM,STOQ,STOA,RSTR,DASTD,CMRA,CETOP,ETOP,YOYProfit,YOYSales,MLEV,DTOA,BLEV\".split(',')\n",
    "factor_folder = 'factors/'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "08e6c16a",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "96b25a6903b642dfbe1703ad3fe22802",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/18 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "for fac in tqdm(names):\n",
    "    execute_string = f\"{fac}=preprocessing(f'{fac}')\"\n",
    "    exec(execute_string)\n",
    "    \n",
    "calendar = SIZE.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ab70e20e",
   "metadata": {},
   "outputs": [],
   "source": [
    "codes = list(SIZE.columns)\n",
    "\n",
    "indus_onehot = pd.read_csv(factor_folder+'industry_onehot.csv',index_col=0)\n",
    "indus_onehot = indus_onehot[indus_onehot.index.isin(codes)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dcddb72f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "117b5c44",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9eb6bdf48d6b400091f470ba15ed3aef",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/2877 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 1.波动率因子需对Beta因子和市值因子进行正交化处理；\n",
    "\n",
    "dds1 = []\n",
    "dds2 = []\n",
    "dds3 = []\n",
    "for i in tqdm(range(len(calendar))):\n",
    "    y1 = DASTD.loc[calendar[i]]\n",
    "    y2 = CMRA.loc[calendar[i]]\n",
    "    y3 = HSIGMA.loc[calendar[i]]\n",
    "    \n",
    "    x1 = SIZE.loc[calendar[i]]\n",
    "    x2 = BETA.loc[calendar[i]]\n",
    "    X = pd.concat([x1,x2],axis=1)\n",
    "    X.columns = ['size','beta']\n",
    "    X = sm.add_constant(X)\n",
    "    \n",
    "    res1 = sm.OLS(y1,X,missing='drop').fit()\n",
    "    res2 = sm.OLS(y2,X,missing='drop').fit()\n",
    "    res3 = sm.OLS(y3,X,missing='drop').fit()\n",
    "    \n",
    "    dds1.append(res1.resid)\n",
    "    dds2.append(res2.resid)\n",
    "    dds3.append(res3.resid)\n",
    "    \n",
    "DASTD = pd.concat(dds1,axis=1)\n",
    "CMRA = pd.concat(dds2,axis=1)\n",
    "HSIGMA = pd.concat(dds3,axis=1)\n",
    "\n",
    "DASTD.columns = calendar\n",
    "CMRA.columns = calendar\n",
    "HSIGMA.columns = calendar\n",
    "\n",
    "DASTD = DASTD.T\n",
    "CMRA = CMRA.T\n",
    "HSIGMA = HSIGMA.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "be93149d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1ace59f7878e4a9fbc80ef395c789164",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/2877 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 2.流动性因子需对市值因子进行正交化处理；\n",
    "\n",
    "dds1 = []\n",
    "dds2 = []\n",
    "dds3 = []\n",
    "for i in tqdm(range(len(calendar))):\n",
    "    y1 = STOM.loc[calendar[i]]\n",
    "    y2 = STOQ.loc[calendar[i]]\n",
    "    y3 = STOA.loc[calendar[i]]\n",
    "    \n",
    "    X = SIZE.loc[calendar[i]]\n",
    "    X = sm.add_constant(X)\n",
    "    \n",
    "    res1 = sm.OLS(y1,X,missing='drop').fit()\n",
    "    res2 = sm.OLS(y2,X,missing='drop').fit()\n",
    "    res3 = sm.OLS(y3,X,missing='drop').fit()\n",
    "    \n",
    "    dds1.append(res1.resid)\n",
    "    dds2.append(res2.resid)\n",
    "    dds3.append(res3.resid)\n",
    "    \n",
    "STOM = pd.concat(dds1,axis=1)\n",
    "STOQ = pd.concat(dds2,axis=1)\n",
    "STOA = pd.concat(dds3,axis=1)\n",
    "\n",
    "STOM.columns = calendar\n",
    "STOQ.columns = calendar\n",
    "STOA.columns = calendar\n",
    "\n",
    "STOM = STOM.T\n",
    "STOQ = STOQ.T\n",
    "STOA = STOA.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "29601c44",
   "metadata": {},
   "outputs": [],
   "source": [
    "facs = [eval(name) for name in names]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "40738b4a",
   "metadata": {},
   "outputs": [],
   "source": [
    "Beta = BETA\n",
    "规模 = SIZE\n",
    "动量 = RSTR\n",
    "波动率 = 0.7*DASTD + 0.15*CMRA + 0.15*HSIGMA\n",
    "非线性规模 = NonLinerSize\n",
    "估值 = BP\n",
    "流动性 = 0.5*STOM + 0.25*STOQ + 0.25*STOA\n",
    "盈利 = 0.5*CETOP + 0.5*ETOP\n",
    "成长 = 0.5*YOYProfit + 0.5*YOYSales\n",
    "杠杆 = (MLEV+DTOA+BLEV)/3\n",
    "\n",
    "风格因子 = ['Beta','规模','波动率','非线性规模','估值','流动性','盈利','成长','杠杆']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "f50d9902",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Beta</th>\n",
       "      <th>规模</th>\n",
       "      <th>波动率</th>\n",
       "      <th>非线性规模</th>\n",
       "      <th>估值</th>\n",
       "      <th>流动性</th>\n",
       "      <th>盈利</th>\n",
       "      <th>成长</th>\n",
       "      <th>杠杆</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Beta</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.037288</td>\n",
       "      <td>0.012898</td>\n",
       "      <td>0.112148</td>\n",
       "      <td>0.004721</td>\n",
       "      <td>0.229819</td>\n",
       "      <td>-0.021915</td>\n",
       "      <td>0.027122</td>\n",
       "      <td>0.046205</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>规模</th>\n",
       "      <td>-0.037288</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.002850</td>\n",
       "      <td>0.185326</td>\n",
       "      <td>0.031355</td>\n",
       "      <td>0.003161</td>\n",
       "      <td>0.079605</td>\n",
       "      <td>0.250291</td>\n",
       "      <td>0.111867</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>波动率</th>\n",
       "      <td>0.012898</td>\n",
       "      <td>-0.002850</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.109827</td>\n",
       "      <td>-0.460389</td>\n",
       "      <td>0.518372</td>\n",
       "      <td>-0.283879</td>\n",
       "      <td>0.046914</td>\n",
       "      <td>-0.223294</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>非线性规模</th>\n",
       "      <td>0.112148</td>\n",
       "      <td>0.185326</td>\n",
       "      <td>-0.109827</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.071218</td>\n",
       "      <td>0.004602</td>\n",
       "      <td>-0.036796</td>\n",
       "      <td>0.109351</td>\n",
       "      <td>-0.004751</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>估值</th>\n",
       "      <td>0.004721</td>\n",
       "      <td>0.031355</td>\n",
       "      <td>-0.460389</td>\n",
       "      <td>-0.071218</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.337090</td>\n",
       "      <td>0.546650</td>\n",
       "      <td>-0.107161</td>\n",
       "      <td>0.509071</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>流动性</th>\n",
       "      <td>0.229819</td>\n",
       "      <td>0.003161</td>\n",
       "      <td>0.518372</td>\n",
       "      <td>0.004602</td>\n",
       "      <td>-0.337090</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.130746</td>\n",
       "      <td>0.133592</td>\n",
       "      <td>-0.157827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>盈利</th>\n",
       "      <td>-0.021915</td>\n",
       "      <td>0.079605</td>\n",
       "      <td>-0.283879</td>\n",
       "      <td>-0.036796</td>\n",
       "      <td>0.546650</td>\n",
       "      <td>-0.130746</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.038684</td>\n",
       "      <td>0.434652</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>成长</th>\n",
       "      <td>0.027122</td>\n",
       "      <td>0.250291</td>\n",
       "      <td>0.046914</td>\n",
       "      <td>0.109351</td>\n",
       "      <td>-0.107161</td>\n",
       "      <td>0.133592</td>\n",
       "      <td>0.038684</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.052788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>杠杆</th>\n",
       "      <td>0.046205</td>\n",
       "      <td>0.111867</td>\n",
       "      <td>-0.223294</td>\n",
       "      <td>-0.004751</td>\n",
       "      <td>0.509071</td>\n",
       "      <td>-0.157827</td>\n",
       "      <td>0.434652</td>\n",
       "      <td>-0.052788</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           Beta        规模       波动率     非线性规模        估值       流动性        盈利  \\\n",
       "Beta   1.000000 -0.037288  0.012898  0.112148  0.004721  0.229819 -0.021915   \n",
       "规模    -0.037288  1.000000 -0.002850  0.185326  0.031355  0.003161  0.079605   \n",
       "波动率    0.012898 -0.002850  1.000000 -0.109827 -0.460389  0.518372 -0.283879   \n",
       "非线性规模  0.112148  0.185326 -0.109827  1.000000 -0.071218  0.004602 -0.036796   \n",
       "估值     0.004721  0.031355 -0.460389 -0.071218  1.000000 -0.337090  0.546650   \n",
       "流动性    0.229819  0.003161  0.518372  0.004602 -0.337090  1.000000 -0.130746   \n",
       "盈利    -0.021915  0.079605 -0.283879 -0.036796  0.546650 -0.130746  1.000000   \n",
       "成长     0.027122  0.250291  0.046914  0.109351 -0.107161  0.133592  0.038684   \n",
       "杠杆     0.046205  0.111867 -0.223294 -0.004751  0.509071 -0.157827  0.434652   \n",
       "\n",
       "             成长        杠杆  \n",
       "Beta   0.027122  0.046205  \n",
       "规模     0.250291  0.111867  \n",
       "波动率    0.046914 -0.223294  \n",
       "非线性规模  0.109351 -0.004751  \n",
       "估值    -0.107161  0.509071  \n",
       "流动性    0.133592 -0.157827  \n",
       "盈利     0.038684  0.434652  \n",
       "成长     1.000000 -0.052788  \n",
       "杠杆    -0.052788  1.000000  "
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "date = calendar[-233]\n",
    "\n",
    "\n",
    "dds = []\n",
    "for name in 风格因子:\n",
    "    dds.append(eval(name).loc[date])\n",
    "    \n",
    "df = pd.concat(dds,axis=1)\n",
    "df.columns = 风格因子\n",
    "df.corr('spearman')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "c7b64421",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>000001.SZ</th>\n",
       "      <th>000002.SZ</th>\n",
       "      <th>000004.SZ</th>\n",
       "      <th>000005.SZ</th>\n",
       "      <th>000006.SZ</th>\n",
       "      <th>000007.SZ</th>\n",
       "      <th>000008.SZ</th>\n",
       "      <th>000009.SZ</th>\n",
       "      <th>000010.SZ</th>\n",
       "      <th>000011.SZ</th>\n",
       "      <th>...</th>\n",
       "      <th>603989.SH</th>\n",
       "      <th>603990.SH</th>\n",
       "      <th>603991.SH</th>\n",
       "      <th>603992.SH</th>\n",
       "      <th>603993.SH</th>\n",
       "      <th>603995.SH</th>\n",
       "      <th>603996.SH</th>\n",
       "      <th>603997.SH</th>\n",
       "      <th>603998.SH</th>\n",
       "      <th>603999.SH</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2010-01-04</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-05</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-06</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-07</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-08</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-02</th>\n",
       "      <td>0.623973</td>\n",
       "      <td>0.605043</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.865725</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.281213</td>\n",
       "      <td>1.316755</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.65608</td>\n",
       "      <td>...</td>\n",
       "      <td>0.614588</td>\n",
       "      <td>1.706041</td>\n",
       "      <td>1.106498</td>\n",
       "      <td>0.678411</td>\n",
       "      <td>0.582861</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.666403</td>\n",
       "      <td>0.637045</td>\n",
       "      <td>0.604038</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-03</th>\n",
       "      <td>0.652082</td>\n",
       "      <td>0.605043</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.865725</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.281213</td>\n",
       "      <td>1.316755</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.65608</td>\n",
       "      <td>...</td>\n",
       "      <td>0.614588</td>\n",
       "      <td>1.706041</td>\n",
       "      <td>1.106498</td>\n",
       "      <td>0.678411</td>\n",
       "      <td>0.582861</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.666403</td>\n",
       "      <td>0.637045</td>\n",
       "      <td>0.604038</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-04</th>\n",
       "      <td>0.652082</td>\n",
       "      <td>0.605043</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.865725</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.281213</td>\n",
       "      <td>1.316755</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.65608</td>\n",
       "      <td>...</td>\n",
       "      <td>0.629502</td>\n",
       "      <td>1.706041</td>\n",
       "      <td>1.106498</td>\n",
       "      <td>0.627133</td>\n",
       "      <td>0.582861</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.666403</td>\n",
       "      <td>0.637045</td>\n",
       "      <td>0.604038</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-05</th>\n",
       "      <td>0.686255</td>\n",
       "      <td>0.609406</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.865725</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.281213</td>\n",
       "      <td>1.316755</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.65608</td>\n",
       "      <td>...</td>\n",
       "      <td>0.629502</td>\n",
       "      <td>1.706041</td>\n",
       "      <td>1.106498</td>\n",
       "      <td>0.602854</td>\n",
       "      <td>0.582861</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.666403</td>\n",
       "      <td>0.637045</td>\n",
       "      <td>0.604038</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-08</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2878 rows × 1933 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            000001.SZ  000002.SZ  000004.SZ  000005.SZ  000006.SZ  000007.SZ  \\\n",
       "trade_date                                                                     \n",
       "2010-01-04        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-05        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-06        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-07        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-08        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "...               ...        ...        ...        ...        ...        ...   \n",
       "2021-11-02   0.623973   0.605043        NaN        NaN   0.865725        NaN   \n",
       "2021-11-03   0.652082   0.605043        NaN        NaN   0.865725        NaN   \n",
       "2021-11-04   0.652082   0.605043        NaN        NaN   0.865725        NaN   \n",
       "2021-11-05   0.686255   0.609406        NaN        NaN   0.865725        NaN   \n",
       "2021-11-08        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "\n",
       "            000008.SZ  000009.SZ  000010.SZ  000011.SZ  ...  603989.SH  \\\n",
       "trade_date                                              ...              \n",
       "2010-01-04        NaN        NaN        NaN        NaN  ...        NaN   \n",
       "2010-01-05        NaN        NaN        NaN        NaN  ...        NaN   \n",
       "2010-01-06        NaN        NaN        NaN        NaN  ...        NaN   \n",
       "2010-01-07        NaN        NaN        NaN        NaN  ...        NaN   \n",
       "2010-01-08        NaN        NaN        NaN        NaN  ...        NaN   \n",
       "...               ...        ...        ...        ...  ...        ...   \n",
       "2021-11-02   0.281213   1.316755        NaN    1.65608  ...   0.614588   \n",
       "2021-11-03   0.281213   1.316755        NaN    1.65608  ...   0.614588   \n",
       "2021-11-04   0.281213   1.316755        NaN    1.65608  ...   0.629502   \n",
       "2021-11-05   0.281213   1.316755        NaN    1.65608  ...   0.629502   \n",
       "2021-11-08        NaN        NaN        NaN        NaN  ...        NaN   \n",
       "\n",
       "            603990.SH  603991.SH  603992.SH  603993.SH  603995.SH  603996.SH  \\\n",
       "trade_date                                                                     \n",
       "2010-01-04        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-05        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-06        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-07        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-08        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "...               ...        ...        ...        ...        ...        ...   \n",
       "2021-11-02   1.706041   1.106498   0.678411   0.582861        NaN        NaN   \n",
       "2021-11-03   1.706041   1.106498   0.678411   0.582861        NaN        NaN   \n",
       "2021-11-04   1.706041   1.106498   0.627133   0.582861        NaN        NaN   \n",
       "2021-11-05   1.706041   1.106498   0.602854   0.582861        NaN        NaN   \n",
       "2021-11-08        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "\n",
       "            603997.SH  603998.SH  603999.SH  \n",
       "trade_date                                   \n",
       "2010-01-04        NaN        NaN        NaN  \n",
       "2010-01-05        NaN        NaN        NaN  \n",
       "2010-01-06        NaN        NaN        NaN  \n",
       "2010-01-07        NaN        NaN        NaN  \n",
       "2010-01-08        NaN        NaN        NaN  \n",
       "...               ...        ...        ...  \n",
       "2021-11-02   0.666403   0.637045   0.604038  \n",
       "2021-11-03   0.666403   0.637045   0.604038  \n",
       "2021-11-04   0.666403   0.637045   0.604038  \n",
       "2021-11-05   0.666403   0.637045   0.604038  \n",
       "2021-11-08        NaN        NaN        NaN  \n",
       "\n",
       "[2878 rows x 1933 columns]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "CMRA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "fce3c170",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>000001.SZ</th>\n",
       "      <th>000002.SZ</th>\n",
       "      <th>000004.SZ</th>\n",
       "      <th>000005.SZ</th>\n",
       "      <th>000006.SZ</th>\n",
       "      <th>000007.SZ</th>\n",
       "      <th>000008.SZ</th>\n",
       "      <th>000009.SZ</th>\n",
       "      <th>000010.SZ</th>\n",
       "      <th>000011.SZ</th>\n",
       "      <th>...</th>\n",
       "      <th>603989.SH</th>\n",
       "      <th>603990.SH</th>\n",
       "      <th>603991.SH</th>\n",
       "      <th>603992.SH</th>\n",
       "      <th>603993.SH</th>\n",
       "      <th>603995.SH</th>\n",
       "      <th>603996.SH</th>\n",
       "      <th>603997.SH</th>\n",
       "      <th>603998.SH</th>\n",
       "      <th>603999.SH</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2010-01-04</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-05</th>\n",
       "      <td>-0.017230</td>\n",
       "      <td>-0.023827</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.034458</td>\n",
       "      <td>-0.031351</td>\n",
       "      <td>0.036136</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.027929</td>\n",
       "      <td>-0.017094</td>\n",
       "      <td>-0.031307</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-06</th>\n",
       "      <td>-0.017532</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.019545</td>\n",
       "      <td>0.003180</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.010292</td>\n",
       "      <td>0.003527</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-07</th>\n",
       "      <td>-0.010944</td>\n",
       "      <td>-0.007117</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.041988</td>\n",
       "      <td>-0.006369</td>\n",
       "      <td>-0.029663</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.019418</td>\n",
       "      <td>-0.038266</td>\n",
       "      <td>-0.023754</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-08</th>\n",
       "      <td>-0.002755</td>\n",
       "      <td>0.007117</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.010239</td>\n",
       "      <td>0.022118</td>\n",
       "      <td>0.008565</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.045937</td>\n",
       "      <td>0.017575</td>\n",
       "      <td>0.009569</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-02</th>\n",
       "      <td>-0.064435</td>\n",
       "      <td>-0.030703</td>\n",
       "      <td>-0.027086</td>\n",
       "      <td>-0.042560</td>\n",
       "      <td>-0.019418</td>\n",
       "      <td>0.010811</td>\n",
       "      <td>-0.013921</td>\n",
       "      <td>-0.040314</td>\n",
       "      <td>-0.030305</td>\n",
       "      <td>-0.018958</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.007117</td>\n",
       "      <td>-0.029162</td>\n",
       "      <td>-0.023373</td>\n",
       "      <td>-0.004786</td>\n",
       "      <td>-0.027029</td>\n",
       "      <td>0.000233</td>\n",
       "      <td>-0.038523</td>\n",
       "      <td>-0.017014</td>\n",
       "      <td>-0.009569</td>\n",
       "      <td>-0.020834</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-03</th>\n",
       "      <td>-0.008285</td>\n",
       "      <td>0.022977</td>\n",
       "      <td>0.020532</td>\n",
       "      <td>0.009615</td>\n",
       "      <td>0.009756</td>\n",
       "      <td>0.048278</td>\n",
       "      <td>-0.004684</td>\n",
       "      <td>-0.032519</td>\n",
       "      <td>0.007663</td>\n",
       "      <td>0.006676</td>\n",
       "      <td>...</td>\n",
       "      <td>0.024693</td>\n",
       "      <td>0.002039</td>\n",
       "      <td>0.003039</td>\n",
       "      <td>0.017438</td>\n",
       "      <td>0.010222</td>\n",
       "      <td>0.006259</td>\n",
       "      <td>-0.006061</td>\n",
       "      <td>0.000953</td>\n",
       "      <td>0.005753</td>\n",
       "      <td>0.010471</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-04</th>\n",
       "      <td>-0.008914</td>\n",
       "      <td>0.000554</td>\n",
       "      <td>0.004175</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.046054</td>\n",
       "      <td>-0.009434</td>\n",
       "      <td>0.032519</td>\n",
       "      <td>-0.005102</td>\n",
       "      <td>0.002848</td>\n",
       "      <td>...</td>\n",
       "      <td>0.095286</td>\n",
       "      <td>0.012649</td>\n",
       "      <td>0.013218</td>\n",
       "      <td>-0.003148</td>\n",
       "      <td>-0.039763</td>\n",
       "      <td>0.023074</td>\n",
       "      <td>0.024025</td>\n",
       "      <td>0.025389</td>\n",
       "      <td>0.001910</td>\n",
       "      <td>0.004158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-05</th>\n",
       "      <td>-0.012954</td>\n",
       "      <td>-0.013378</td>\n",
       "      <td>0.022367</td>\n",
       "      <td>-0.004796</td>\n",
       "      <td>-0.007308</td>\n",
       "      <td>-0.027780</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.068304</td>\n",
       "      <td>-0.015464</td>\n",
       "      <td>-0.016245</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.000975</td>\n",
       "      <td>-0.009598</td>\n",
       "      <td>0.004367</td>\n",
       "      <td>-0.011097</td>\n",
       "      <td>-0.032261</td>\n",
       "      <td>0.046120</td>\n",
       "      <td>0.008863</td>\n",
       "      <td>0.025666</td>\n",
       "      <td>-0.001910</td>\n",
       "      <td>0.014418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-08</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2878 rows × 1933 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            000001.SZ  000002.SZ  000004.SZ  000005.SZ  000006.SZ  000007.SZ  \\\n",
       "trade_date                                                                     \n",
       "2010-01-04        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-05  -0.017230  -0.023827        NaN   0.034458  -0.031351   0.036136   \n",
       "2010-01-06  -0.017532   0.000000        NaN  -0.019545   0.003180   0.000000   \n",
       "2010-01-07  -0.010944  -0.007117        NaN  -0.041988  -0.006369  -0.029663   \n",
       "2010-01-08  -0.002755   0.007117        NaN   0.010239   0.022118   0.008565   \n",
       "...               ...        ...        ...        ...        ...        ...   \n",
       "2021-11-02  -0.064435  -0.030703  -0.027086  -0.042560  -0.019418   0.010811   \n",
       "2021-11-03  -0.008285   0.022977   0.020532   0.009615   0.009756   0.048278   \n",
       "2021-11-04  -0.008914   0.000554   0.004175   0.000000   0.000000   0.046054   \n",
       "2021-11-05  -0.012954  -0.013378   0.022367  -0.004796  -0.007308  -0.027780   \n",
       "2021-11-08        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "\n",
       "            000008.SZ  000009.SZ  000010.SZ  000011.SZ  ...  603989.SH  \\\n",
       "trade_date                                              ...              \n",
       "2010-01-04        NaN        NaN        NaN        NaN  ...        NaN   \n",
       "2010-01-05        NaN  -0.027929  -0.017094  -0.031307  ...        NaN   \n",
       "2010-01-06        NaN   0.000000   0.010292   0.003527  ...        NaN   \n",
       "2010-01-07        NaN   0.019418  -0.038266  -0.023754  ...        NaN   \n",
       "2010-01-08        NaN   0.045937   0.017575   0.009569  ...        NaN   \n",
       "...               ...        ...        ...        ...  ...        ...   \n",
       "2021-11-02  -0.013921  -0.040314  -0.030305  -0.018958  ...  -0.007117   \n",
       "2021-11-03  -0.004684  -0.032519   0.007663   0.006676  ...   0.024693   \n",
       "2021-11-04  -0.009434   0.032519  -0.005102   0.002848  ...   0.095286   \n",
       "2021-11-05   0.000000  -0.068304  -0.015464  -0.016245  ...  -0.000975   \n",
       "2021-11-08        NaN        NaN        NaN        NaN  ...        NaN   \n",
       "\n",
       "            603990.SH  603991.SH  603992.SH  603993.SH  603995.SH  603996.SH  \\\n",
       "trade_date                                                                     \n",
       "2010-01-04        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-05        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-06        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-07        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-08        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "...               ...        ...        ...        ...        ...        ...   \n",
       "2021-11-02  -0.029162  -0.023373  -0.004786  -0.027029   0.000233  -0.038523   \n",
       "2021-11-03   0.002039   0.003039   0.017438   0.010222   0.006259  -0.006061   \n",
       "2021-11-04   0.012649   0.013218  -0.003148  -0.039763   0.023074   0.024025   \n",
       "2021-11-05  -0.009598   0.004367  -0.011097  -0.032261   0.046120   0.008863   \n",
       "2021-11-08        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "\n",
       "            603997.SH  603998.SH  603999.SH  \n",
       "trade_date                                   \n",
       "2010-01-04        NaN        NaN        NaN  \n",
       "2010-01-05        NaN        NaN        NaN  \n",
       "2010-01-06        NaN        NaN        NaN  \n",
       "2010-01-07        NaN        NaN        NaN  \n",
       "2010-01-08        NaN        NaN        NaN  \n",
       "...               ...        ...        ...  \n",
       "2021-11-02  -0.017014  -0.009569  -0.020834  \n",
       "2021-11-03   0.000953   0.005753   0.010471  \n",
       "2021-11-04   0.025389   0.001910   0.004158  \n",
       "2021-11-05   0.025666  -0.001910   0.014418  \n",
       "2021-11-08        NaN        NaN        NaN  \n",
       "\n",
       "[2878 rows x 1933 columns]"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "close_ret = pd.read_csv('factors/close_ret.csv',index_col=0)\n",
    "close_ret"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "d5788125",
   "metadata": {},
   "outputs": [],
   "source": [
    "ii = -20\n",
    "rdate = calendar[ii]\n",
    "fdate = calendar[ii-1]\n",
    "\n",
    "r = close_ret.loc[rdate].values\n",
    "\n",
    "dds = []\n",
    "for name in 风格因子:\n",
    "    dds.append(eval(name).loc[fdate])\n",
    "    \n",
    "dfs = pd.concat(dds,axis=1)\n",
    "dfs.columns = 风格因子"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "380a44ea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Beta</th>\n",
       "      <th>规模</th>\n",
       "      <th>波动率</th>\n",
       "      <th>非线性规模</th>\n",
       "      <th>估值</th>\n",
       "      <th>流动性</th>\n",
       "      <th>盈利</th>\n",
       "      <th>成长</th>\n",
       "      <th>杠杆</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>000001.SZ</th>\n",
       "      <td>8.200241</td>\n",
       "      <td>14.715370</td>\n",
       "      <td>-0.075165</td>\n",
       "      <td>-1.343531</td>\n",
       "      <td>0.775699</td>\n",
       "      <td>-0.797715</td>\n",
       "      <td>0.254572</td>\n",
       "      <td>0.257034</td>\n",
       "      <td>0.698786</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000002.SZ</th>\n",
       "      <td>8.200241</td>\n",
       "      <td>14.715370</td>\n",
       "      <td>-0.142557</td>\n",
       "      <td>1.097936</td>\n",
       "      <td>0.775699</td>\n",
       "      <td>-0.403070</td>\n",
       "      <td>0.471009</td>\n",
       "      <td>-0.034963</td>\n",
       "      <td>566.557472</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000004.SZ</th>\n",
       "      <td>8.081351</td>\n",
       "      <td>12.607870</td>\n",
       "      <td>0.006340</td>\n",
       "      <td>-1.343531</td>\n",
       "      <td>0.489428</td>\n",
       "      <td>0.848537</td>\n",
       "      <td>0.064937</td>\n",
       "      <td>-0.125819</td>\n",
       "      <td>5.448147</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000005.SZ</th>\n",
       "      <td>0.121367</td>\n",
       "      <td>12.344540</td>\n",
       "      <td>-0.011358</td>\n",
       "      <td>-0.541863</td>\n",
       "      <td>0.623986</td>\n",
       "      <td>0.004783</td>\n",
       "      <td>0.114694</td>\n",
       "      <td>-0.222131</td>\n",
       "      <td>26.584410</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000006.SZ</th>\n",
       "      <td>2.201887</td>\n",
       "      <td>13.334725</td>\n",
       "      <td>0.020485</td>\n",
       "      <td>1.453474</td>\n",
       "      <td>0.775699</td>\n",
       "      <td>-0.669922</td>\n",
       "      <td>0.292868</td>\n",
       "      <td>0.168670</td>\n",
       "      <td>566.816387</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603995.SH</th>\n",
       "      <td>8.200241</td>\n",
       "      <td>13.756080</td>\n",
       "      <td>-0.023068</td>\n",
       "      <td>0.357422</td>\n",
       "      <td>0.347814</td>\n",
       "      <td>0.621665</td>\n",
       "      <td>0.466229</td>\n",
       "      <td>0.596613</td>\n",
       "      <td>311.231788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603996.SH</th>\n",
       "      <td>4.762249</td>\n",
       "      <td>12.264199</td>\n",
       "      <td>0.133265</td>\n",
       "      <td>-1.343531</td>\n",
       "      <td>0.775699</td>\n",
       "      <td>0.289065</td>\n",
       "      <td>0.048903</td>\n",
       "      <td>-0.299684</td>\n",
       "      <td>267.083612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603997.SH</th>\n",
       "      <td>5.371332</td>\n",
       "      <td>13.918097</td>\n",
       "      <td>-0.038654</td>\n",
       "      <td>1.453474</td>\n",
       "      <td>0.421888</td>\n",
       "      <td>-0.179717</td>\n",
       "      <td>0.450407</td>\n",
       "      <td>-0.125819</td>\n",
       "      <td>566.709456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603998.SH</th>\n",
       "      <td>-0.882452</td>\n",
       "      <td>12.390395</td>\n",
       "      <td>-0.042630</td>\n",
       "      <td>0.204712</td>\n",
       "      <td>0.485861</td>\n",
       "      <td>-0.551406</td>\n",
       "      <td>0.310475</td>\n",
       "      <td>0.122755</td>\n",
       "      <td>138.674910</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603999.SH</th>\n",
       "      <td>0.128794</td>\n",
       "      <td>12.572714</td>\n",
       "      <td>-0.069659</td>\n",
       "      <td>0.777439</td>\n",
       "      <td>0.608865</td>\n",
       "      <td>-0.856778</td>\n",
       "      <td>0.214493</td>\n",
       "      <td>0.138233</td>\n",
       "      <td>114.811715</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1933 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               Beta         规模       波动率     非线性规模        估值       流动性  \\\n",
       "000001.SZ  8.200241  14.715370 -0.075165 -1.343531  0.775699 -0.797715   \n",
       "000002.SZ  8.200241  14.715370 -0.142557  1.097936  0.775699 -0.403070   \n",
       "000004.SZ  8.081351  12.607870  0.006340 -1.343531  0.489428  0.848537   \n",
       "000005.SZ  0.121367  12.344540 -0.011358 -0.541863  0.623986  0.004783   \n",
       "000006.SZ  2.201887  13.334725  0.020485  1.453474  0.775699 -0.669922   \n",
       "...             ...        ...       ...       ...       ...       ...   \n",
       "603995.SH  8.200241  13.756080 -0.023068  0.357422  0.347814  0.621665   \n",
       "603996.SH  4.762249  12.264199  0.133265 -1.343531  0.775699  0.289065   \n",
       "603997.SH  5.371332  13.918097 -0.038654  1.453474  0.421888 -0.179717   \n",
       "603998.SH -0.882452  12.390395 -0.042630  0.204712  0.485861 -0.551406   \n",
       "603999.SH  0.128794  12.572714 -0.069659  0.777439  0.608865 -0.856778   \n",
       "\n",
       "                 盈利        成长          杠杆  \n",
       "000001.SZ  0.254572  0.257034    0.698786  \n",
       "000002.SZ  0.471009 -0.034963  566.557472  \n",
       "000004.SZ  0.064937 -0.125819    5.448147  \n",
       "000005.SZ  0.114694 -0.222131   26.584410  \n",
       "000006.SZ  0.292868  0.168670  566.816387  \n",
       "...             ...       ...         ...  \n",
       "603995.SH  0.466229  0.596613  311.231788  \n",
       "603996.SH  0.048903 -0.299684  267.083612  \n",
       "603997.SH  0.450407 -0.125819  566.709456  \n",
       "603998.SH  0.310475  0.122755  138.674910  \n",
       "603999.SH  0.214493  0.138233  114.811715  \n",
       "\n",
       "[1933 rows x 9 columns]"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dfs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a2d14b72",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "952b8713",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>交通运输</th>\n",
       "      <th>休闲服务</th>\n",
       "      <th>传媒</th>\n",
       "      <th>公用事业</th>\n",
       "      <th>农林牧渔</th>\n",
       "      <th>化工</th>\n",
       "      <th>医药生物</th>\n",
       "      <th>商业贸易</th>\n",
       "      <th>国防军工</th>\n",
       "      <th>家用电器</th>\n",
       "      <th>...</th>\n",
       "      <th>纺织服装</th>\n",
       "      <th>综合</th>\n",
       "      <th>计算机</th>\n",
       "      <th>轻工制造</th>\n",
       "      <th>通信</th>\n",
       "      <th>采掘</th>\n",
       "      <th>钢铁</th>\n",
       "      <th>银行</th>\n",
       "      <th>非银金融</th>\n",
       "      <th>食品饮料</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ts_code</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>000552.SZ</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000571.SZ</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000629.SZ</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000655.SZ</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000723.SZ</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600811.SH</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600817.SH</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600818.SH</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603060.SH</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603183.SH</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1933 rows × 28 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           交通运输  休闲服务  传媒  公用事业  农林牧渔  化工  医药生物  商业贸易  国防军工  家用电器  ...  纺织服装  \\\n",
       "ts_code                                                            ...         \n",
       "000552.SZ     0     0   0     0     0   0     0     0     0     0  ...     0   \n",
       "000571.SZ     0     0   0     0     0   0     0     0     0     0  ...     0   \n",
       "000629.SZ     0     0   0     0     0   0     0     0     0     0  ...     0   \n",
       "000655.SZ     0     0   0     0     0   0     0     0     0     0  ...     0   \n",
       "000723.SZ     0     0   0     0     0   0     0     0     0     0  ...     0   \n",
       "...         ...   ...  ..   ...   ...  ..   ...   ...   ...   ...  ...   ...   \n",
       "600811.SH     0     0   0     0     0   0     0     0     0     0  ...     0   \n",
       "600817.SH     0     0   0     0     0   0     0     0     0     0  ...     0   \n",
       "600818.SH     0     0   0     0     0   0     0     0     0     0  ...     0   \n",
       "603060.SH     0     0   0     0     0   0     0     0     0     0  ...     0   \n",
       "603183.SH     0     0   0     0     0   0     0     0     0     0  ...     0   \n",
       "\n",
       "           综合  计算机  轻工制造  通信  采掘  钢铁  银行  非银金融  食品饮料  \n",
       "ts_code                                               \n",
       "000552.SZ   0    0     0   0   1   0   0     0     0  \n",
       "000571.SZ   0    0     0   0   1   0   0     0     0  \n",
       "000629.SZ   0    0     0   0   1   0   0     0     0  \n",
       "000655.SZ   0    0     0   0   1   0   0     0     0  \n",
       "000723.SZ   0    0     0   0   1   0   0     0     0  \n",
       "...        ..  ...   ...  ..  ..  ..  ..   ...   ...  \n",
       "600811.SH   1    0     0   0   0   0   0     0     0  \n",
       "600817.SH   1    0     0   0   0   0   0     0     0  \n",
       "600818.SH   1    0     0   0   0   0   0     0     0  \n",
       "603060.SH   1    0     0   0   0   0   0     0     0  \n",
       "603183.SH   1    0     0   0   0   0   0     0     0  \n",
       "\n",
       "[1933 rows x 28 columns]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "indus_onehot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "ce8e6546",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUg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fpC1o8Xr1qy/Pcuz7OoMdtVpNe6n2a+WdHzEXE9cC/AhtGXdiItW2cetHacYqIMeBe4NOZ+eqZqxfYpRVj1aWv1o7XUrRl5t7L4wza9siDrvVm5quZOde8fgg4PyLWLF+JI9G2ceqqreMUEeczH4B3Z+Z9C2zSyrHq1ldbx2up2hLuvTzOYB/wR80V/g8ApzLzpeUudAm69hQRvxQR0bzezPx4/XjZKx2uto1TV20cp6bevcChzLx9kc1aN1a99NXG8epHK07L5CKPM4iIP2vW/wPwEPNX9w8D/wv88UrV24see/oI8OcRcRp4HdiazeX+1Soivsb83QhrIuIo8FngfGjnOEFPPbVunIBrgJuAAxHxTLPsM8AvQ3vHit76auN4LZmPH5CkgtpyWkaStASGuyQVZLhLUkGGuyQVZLhLUkGGuyQVZLhLUkH/D8DklsgADpKoAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fac.iloc[-10].hist(bins=30)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "id": "0cdcf948",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "000001.SZ   -0.724525\n",
       "000002.SZ    0.025168\n",
       "000004.SZ    0.147731\n",
       "000005.SZ   -0.047518\n",
       "000006.SZ    0.264153\n",
       "               ...   \n",
       "603993.SH   -0.024736\n",
       "603995.SH   -0.755845\n",
       "603997.SH   -0.108311\n",
       "603998.SH    0.043517\n",
       "603999.SH   -0.030019\n",
       "Length: 1903, dtype: float64"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y = fac.iloc[-1]\n",
    "X = pd.concat([SIZE.iloc[-1],indus_onehot],axis=1)\n",
    "model = sm.OLS(y,X,missing='drop')\n",
    "res = model.fit()\n",
    "res.resid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "id": "5e2b0ced",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x253b1785400>"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAzPUlEQVR4nO2df5Ac5Xnnv8+OZmFWSZgl6M5oYBGmOCnRyWitPVDC3RXSXZCNAt5Y2JjIdp3rqig7zlXEka2IFGcJHyl0teWY+EhMKYkr54IjAkRNhIVPThXK2VYswi67iywj5cDCQiPuLINGDtoBzc4+98dMj3p6+u1+e6Z/vNPzfKpU2p3pnXl6pvt5n/f5ScwMQRAEofcZSFoAQRAEIRxEoQuCIKQEUeiCIAgpQRS6IAhCShCFLgiCkBKWJPXGV1xxBa9YsSKptxcEQehJpqenf8bMy9yeS0yhr1ixAlNTU0m9vSAIQk9CRD9RPScuF0EQhJQgCl0QBCEliEIXBEFICaLQBUEQUoIodEEQhJTgm+VCRJcC+C6ASxrHP8PMOxzHEIA/AXAbgHkA/4GZXw5fXEHoD4ozJUweOI7T5QqW53OY2LQS46OFpMUSDEcnbfF9ABuZ+V0iygL4PhF9m5kP2475KIDrG/9uAvD1xv+CIASkOFPC/c8eQaVaAwCUyhXc/+wRABClLnji63LhOu82fs02/jl77n4MwDcbxx4GkCeiK8MVVRD6g8kDx5vK3KJSrWHywPGEJBJ6BS0fOhFliGgWwE8B/C0zv+g4pADgTdvvpxqPOV/nHiKaIqKpM2fOdCiyIKSb0+VKoMcFwUJLoTNzjZnXArgKwI1E9C8dh5Dbn7m8zm5mHmPmsWXLXCtXBaHvWZ7PBXpcECwCZbkwcxnA3wH4iOOpUwCutv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Ny7OKwDcRkQLzFyMRUL9od4/Y+bzAM4T0XcB3ID67Ng40JHxcwB2cd1p+RoRnQCwCsA/xCOiL8YMRvci4ftFh6TvFx2Svl+0Mcnl8hKA64noWiIaBPApAPvsBxDRCIBnAXwmodXRV0ZmvpaZVzDzCgDPAPidmC9OXxkB/A2Af0NES4hoCPXB3q8aJuNJ1C0iENE/B7ASwI9jlNGPfQA+28h2WQ/gHDO/lbRQdgy4X3wx4H7RIen7RRtjLHRmXiCi3wVwABeHUR8l2zBqAF8C8MsA/qyxoi9wjJ3QNGVMFB0ZmflVIvpfAF4BsAjgL5jZM60sbhkB/FcAf0VER1B3b/wBM8fWxpSIngRwC4AriOgUgB0Asjb5nkc90+U1NAajxyVbABkTvV80ZUwcPxmTvl+CIKX/giAIKcEkl4sgCILQBaLQBUEQUoIodEEQhJQgCl0QBCEliEIXBEFICaLQBUEQUoIodEEQhJTw/wEO8bIy4NGpSAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "y1 = (res.params*X).sum(1).values\n",
    "y2 = y\n",
    "plt.scatter(y1,y2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "id": "faa80e59",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table class=\"simpletable\">\n",
       "<caption>OLS Regression Results</caption>\n",
       "<tr>\n",
       "  <th>Dep. Variable:</th>       <td>2021-11-05</td>    <th>  R-squared:         </th> <td>   0.315</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Model:</th>                   <td>OLS</td>       <th>  Adj. R-squared:    </th> <td>   0.305</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Method:</th>             <td>Least Squares</td>  <th>  F-statistic:       </th> <td>   30.84</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Date:</th>             <td>Fri, 12 Nov 2021</td> <th>  Prob (F-statistic):</th> <td>1.45e-132</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Time:</th>                 <td>14:46:13</td>     <th>  Log-Likelihood:    </th> <td> -789.88</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>No. Observations:</th>      <td>  1903</td>      <th>  AIC:               </th> <td>   1638.</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Df Residuals:</th>          <td>  1874</td>      <th>  BIC:               </th> <td>   1799.</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Df Model:</th>              <td>    28</td>      <th>                     </th>     <td> </td>    \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Covariance Type:</th>      <td>nonrobust</td>    <th>                     </th>     <td> </td>    \n",
       "</tr>\n",
       "</table>\n",
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "       <td></td>         <th>coef</th>     <th>std err</th>      <th>t</th>      <th>P>|t|</th>  <th>[0.025</th>    <th>0.975]</th>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>2021-11-05</th> <td>   -0.0139</td> <td>    0.007</td> <td>   -1.916</td> <td> 0.055</td> <td>   -0.028</td> <td>    0.000</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>交通运输</th>       <td>    1.0578</td> <td>    0.108</td> <td>    9.794</td> <td> 0.000</td> <td>    0.846</td> <td>    1.270</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>休闲服务</th>       <td>    0.6435</td> <td>    0.120</td> <td>    5.345</td> <td> 0.000</td> <td>    0.407</td> <td>    0.880</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>传媒</th>         <td>    0.8416</td> <td>    0.106</td> <td>    7.934</td> <td> 0.000</td> <td>    0.634</td> <td>    1.050</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>公用事业</th>       <td>    0.8708</td> <td>    0.106</td> <td>    8.233</td> <td> 0.000</td> <td>    0.663</td> <td>    1.078</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>农林牧渔</th>       <td>    0.5302</td> <td>    0.112</td> <td>    4.740</td> <td> 0.000</td> <td>    0.311</td> <td>    0.750</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>化工</th>         <td>    0.6819</td> <td>    0.103</td> <td>    6.594</td> <td> 0.000</td> <td>    0.479</td> <td>    0.885</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>医药生物</th>       <td>    0.6573</td> <td>    0.105</td> <td>    6.285</td> <td> 0.000</td> <td>    0.452</td> <td>    0.862</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>商业贸易</th>       <td>    0.8491</td> <td>    0.105</td> <td>    8.106</td> <td> 0.000</td> <td>    0.644</td> <td>    1.054</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>国防军工</th>       <td>    0.5277</td> <td>    0.124</td> <td>    4.251</td> <td> 0.000</td> <td>    0.284</td> <td>    0.771</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>家用电器</th>       <td>    0.7588</td> <td>    0.124</td> <td>    6.118</td> <td> 0.000</td> <td>    0.516</td> <td>    1.002</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>建筑材料</th>       <td>    0.9292</td> <td>    0.119</td> <td>    7.795</td> <td> 0.000</td> <td>    0.695</td> <td>    1.163</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>建筑装饰</th>       <td>    0.9898</td> <td>    0.108</td> <td>    9.153</td> <td> 0.000</td> <td>    0.778</td> <td>    1.202</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>房地产</th>        <td>    1.3085</td> <td>    0.104</td> <td>   12.643</td> <td> 0.000</td> <td>    1.106</td> <td>    1.512</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>有色金属</th>       <td>    0.5847</td> <td>    0.111</td> <td>    5.252</td> <td> 0.000</td> <td>    0.366</td> <td>    0.803</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>机械设备</th>       <td>    0.6707</td> <td>    0.102</td> <td>    6.555</td> <td> 0.000</td> <td>    0.470</td> <td>    0.871</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>汽车</th>         <td>    0.6881</td> <td>    0.105</td> <td>    6.555</td> <td> 0.000</td> <td>    0.482</td> <td>    0.894</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>电子</th>         <td>    0.5704</td> <td>    0.111</td> <td>    5.137</td> <td> 0.000</td> <td>    0.353</td> <td>    0.788</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>电气设备</th>       <td>    0.5693</td> <td>    0.110</td> <td>    5.180</td> <td> 0.000</td> <td>    0.354</td> <td>    0.785</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>纺织服装</th>       <td>    0.7942</td> <td>    0.109</td> <td>    7.287</td> <td> 0.000</td> <td>    0.580</td> <td>    1.008</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>综合</th>         <td>    0.8292</td> <td>    0.118</td> <td>    7.008</td> <td> 0.000</td> <td>    0.597</td> <td>    1.061</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>计算机</th>        <td>    0.5827</td> <td>    0.113</td> <td>    5.134</td> <td> 0.000</td> <td>    0.360</td> <td>    0.805</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>轻工制造</th>       <td>    0.7008</td> <td>    0.106</td> <td>    6.603</td> <td> 0.000</td> <td>    0.493</td> <td>    0.909</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>通信</th>         <td>    0.6410</td> <td>    0.115</td> <td>    5.554</td> <td> 0.000</td> <td>    0.415</td> <td>    0.867</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>采掘</th>         <td>    0.9034</td> <td>    0.115</td> <td>    7.855</td> <td> 0.000</td> <td>    0.678</td> <td>    1.129</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>钢铁</th>         <td>    1.2673</td> <td>    0.127</td> <td>    9.974</td> <td> 0.000</td> <td>    1.018</td> <td>    1.516</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>银行</th>         <td>    1.8981</td> <td>    0.137</td> <td>   13.850</td> <td> 0.000</td> <td>    1.629</td> <td>    2.167</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>非银金融</th>       <td>    0.9703</td> <td>    0.117</td> <td>    8.264</td> <td> 0.000</td> <td>    0.740</td> <td>    1.201</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>食品饮料</th>       <td>    0.4868</td> <td>    0.114</td> <td>    4.284</td> <td> 0.000</td> <td>    0.264</td> <td>    0.710</td>\n",
       "</tr>\n",
       "</table>\n",
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "  <th>Omnibus:</th>       <td>319.997</td> <th>  Durbin-Watson:     </th> <td>   1.856</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Prob(Omnibus):</th> <td> 0.000</td>  <th>  Jarque-Bera (JB):  </th> <td> 839.555</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Skew:</th>          <td> 0.901</td>  <th>  Prob(JB):          </th> <td>4.93e-183</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Kurtosis:</th>      <td> 5.709</td>  <th>  Cond. No.          </th> <td>    869.</td> \n",
       "</tr>\n",
       "</table><br/><br/>Notes:<br/>[1] Standard Errors assume that the covariance matrix of the errors is correctly specified."
      ],
      "text/plain": [
       "<class 'statsmodels.iolib.summary.Summary'>\n",
       "\"\"\"\n",
       "                            OLS Regression Results                            \n",
       "==============================================================================\n",
       "Dep. Variable:             2021-11-05   R-squared:                       0.315\n",
       "Model:                            OLS   Adj. R-squared:                  0.305\n",
       "Method:                 Least Squares   F-statistic:                     30.84\n",
       "Date:                Fri, 12 Nov 2021   Prob (F-statistic):          1.45e-132\n",
       "Time:                        14:46:13   Log-Likelihood:                -789.88\n",
       "No. Observations:                1903   AIC:                             1638.\n",
       "Df Residuals:                    1874   BIC:                             1799.\n",
       "Df Model:                          28                                         \n",
       "Covariance Type:            nonrobust                                         \n",
       "==============================================================================\n",
       "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
       "------------------------------------------------------------------------------\n",
       "2021-11-05    -0.0139      0.007     -1.916      0.055      -0.028       0.000\n",
       "交通运输           1.0578      0.108      9.794      0.000       0.846       1.270\n",
       "休闲服务           0.6435      0.120      5.345      0.000       0.407       0.880\n",
       "传媒             0.8416      0.106      7.934      0.000       0.634       1.050\n",
       "公用事业           0.8708      0.106      8.233      0.000       0.663       1.078\n",
       "农林牧渔           0.5302      0.112      4.740      0.000       0.311       0.750\n",
       "化工             0.6819      0.103      6.594      0.000       0.479       0.885\n",
       "医药生物           0.6573      0.105      6.285      0.000       0.452       0.862\n",
       "商业贸易           0.8491      0.105      8.106      0.000       0.644       1.054\n",
       "国防军工           0.5277      0.124      4.251      0.000       0.284       0.771\n",
       "家用电器           0.7588      0.124      6.118      0.000       0.516       1.002\n",
       "建筑材料           0.9292      0.119      7.795      0.000       0.695       1.163\n",
       "建筑装饰           0.9898      0.108      9.153      0.000       0.778       1.202\n",
       "房地产            1.3085      0.104     12.643      0.000       1.106       1.512\n",
       "有色金属           0.5847      0.111      5.252      0.000       0.366       0.803\n",
       "机械设备           0.6707      0.102      6.555      0.000       0.470       0.871\n",
       "汽车             0.6881      0.105      6.555      0.000       0.482       0.894\n",
       "电子             0.5704      0.111      5.137      0.000       0.353       0.788\n",
       "电气设备           0.5693      0.110      5.180      0.000       0.354       0.785\n",
       "纺织服装           0.7942      0.109      7.287      0.000       0.580       1.008\n",
       "综合             0.8292      0.118      7.008      0.000       0.597       1.061\n",
       "计算机            0.5827      0.113      5.134      0.000       0.360       0.805\n",
       "轻工制造           0.7008      0.106      6.603      0.000       0.493       0.909\n",
       "通信             0.6410      0.115      5.554      0.000       0.415       0.867\n",
       "采掘             0.9034      0.115      7.855      0.000       0.678       1.129\n",
       "钢铁             1.2673      0.127      9.974      0.000       1.018       1.516\n",
       "银行             1.8981      0.137     13.850      0.000       1.629       2.167\n",
       "非银金融           0.9703      0.117      8.264      0.000       0.740       1.201\n",
       "食品饮料           0.4868      0.114      4.284      0.000       0.264       0.710\n",
       "==============================================================================\n",
       "Omnibus:                      319.997   Durbin-Watson:                   1.856\n",
       "Prob(Omnibus):                  0.000   Jarque-Bera (JB):              839.555\n",
       "Skew:                           0.901   Prob(JB):                    4.93e-183\n",
       "Kurtosis:                       5.709   Cond. No.                         869.\n",
       "==============================================================================\n",
       "\n",
       "Notes:\n",
       "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
       "\"\"\""
      ]
     },
     "execution_count": 121,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ce3e7303",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "id": "d5ca223d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2021-11-05   -0.013944\n",
       "交通运输          1.057762\n",
       "休闲服务          0.643500\n",
       "传媒            0.841574\n",
       "公用事业          0.870823\n",
       "农林牧渔          0.530171\n",
       "化工            0.681928\n",
       "医药生物          0.657319\n",
       "商业贸易          0.849059\n",
       "国防军工          0.527728\n",
       "家用电器          0.758787\n",
       "建筑材料          0.929233\n",
       "建筑装饰          0.989751\n",
       "房地产           1.308519\n",
       "有色金属          0.584687\n",
       "机械设备          0.670683\n",
       "汽车            0.688053\n",
       "电子            0.570379\n",
       "电气设备          0.569323\n",
       "纺织服装          0.794184\n",
       "综合            0.829230\n",
       "计算机           0.582695\n",
       "轻工制造          0.700802\n",
       "通信            0.640984\n",
       "采掘            0.903410\n",
       "钢铁            1.267297\n",
       "银行            1.898054\n",
       "非银金融          0.970301\n",
       "食品饮料          0.486758\n",
       "dtype: float64"
      ]
     },
     "execution_count": 122,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res.params"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "id": "bf86864a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>000001.SZ</th>\n",
       "      <th>000002.SZ</th>\n",
       "      <th>000004.SZ</th>\n",
       "      <th>000005.SZ</th>\n",
       "      <th>000006.SZ</th>\n",
       "      <th>000007.SZ</th>\n",
       "      <th>000008.SZ</th>\n",
       "      <th>000009.SZ</th>\n",
       "      <th>000010.SZ</th>\n",
       "      <th>000011.SZ</th>\n",
       "      <th>...</th>\n",
       "      <th>603989.SH</th>\n",
       "      <th>603990.SH</th>\n",
       "      <th>603991.SH</th>\n",
       "      <th>603992.SH</th>\n",
       "      <th>603993.SH</th>\n",
       "      <th>603995.SH</th>\n",
       "      <th>603996.SH</th>\n",
       "      <th>603997.SH</th>\n",
       "      <th>603998.SH</th>\n",
       "      <th>603999.SH</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2010-01-04</th>\n",
       "      <td>0.259249</td>\n",
       "      <td>0.299814</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.135157</td>\n",
       "      <td>0.334258</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.160154</td>\n",
       "      <td>0.026386</td>\n",
       "      <td>0.114291</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-05</th>\n",
       "      <td>0.263810</td>\n",
       "      <td>0.306758</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.130579</td>\n",
       "      <td>0.344163</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.164401</td>\n",
       "      <td>0.026864</td>\n",
       "      <td>0.117950</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-06</th>\n",
       "      <td>0.268420</td>\n",
       "      <td>0.306758</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.133156</td>\n",
       "      <td>0.343206</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.164558</td>\n",
       "      <td>0.026589</td>\n",
       "      <td>0.117607</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-07</th>\n",
       "      <td>0.271378</td>\n",
       "      <td>0.309148</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.138866</td>\n",
       "      <td>0.346081</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.161496</td>\n",
       "      <td>0.027675</td>\n",
       "      <td>0.120402</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-08</th>\n",
       "      <td>0.271983</td>\n",
       "      <td>0.307050</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.137451</td>\n",
       "      <td>0.337895</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.154043</td>\n",
       "      <td>0.027192</td>\n",
       "      <td>0.119222</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-01</th>\n",
       "      <td>0.847529</td>\n",
       "      <td>1.076426</td>\n",
       "      <td>0.567376</td>\n",
       "      <td>0.627628</td>\n",
       "      <td>1.365001</td>\n",
       "      <td>0.039004</td>\n",
       "      <td>1.068719</td>\n",
       "      <td>0.146724</td>\n",
       "      <td>0.156255</td>\n",
       "      <td>0.670826</td>\n",
       "      <td>...</td>\n",
       "      <td>0.193885</td>\n",
       "      <td>0.318522</td>\n",
       "      <td>0.108844</td>\n",
       "      <td>0.282374</td>\n",
       "      <td>0.304535</td>\n",
       "      <td>0.342689</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.398073</td>\n",
       "      <td>0.527009</td>\n",
       "      <td>0.641807</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-02</th>\n",
       "      <td>0.903914</td>\n",
       "      <td>1.110001</td>\n",
       "      <td>0.582954</td>\n",
       "      <td>0.654922</td>\n",
       "      <td>1.391788</td>\n",
       "      <td>0.038585</td>\n",
       "      <td>1.083658</td>\n",
       "      <td>0.152760</td>\n",
       "      <td>0.161064</td>\n",
       "      <td>0.683667</td>\n",
       "      <td>...</td>\n",
       "      <td>0.195271</td>\n",
       "      <td>0.327955</td>\n",
       "      <td>0.111417</td>\n",
       "      <td>0.283728</td>\n",
       "      <td>0.312881</td>\n",
       "      <td>0.342618</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.404907</td>\n",
       "      <td>0.532085</td>\n",
       "      <td>0.655308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-03</th>\n",
       "      <td>0.911494</td>\n",
       "      <td>1.084716</td>\n",
       "      <td>0.571102</td>\n",
       "      <td>0.648635</td>\n",
       "      <td>1.378360</td>\n",
       "      <td>0.036766</td>\n",
       "      <td>1.088732</td>\n",
       "      <td>0.157808</td>\n",
       "      <td>0.159834</td>\n",
       "      <td>0.679117</td>\n",
       "      <td>...</td>\n",
       "      <td>0.190505</td>\n",
       "      <td>0.327279</td>\n",
       "      <td>0.111079</td>\n",
       "      <td>0.278823</td>\n",
       "      <td>0.309693</td>\n",
       "      <td>0.340483</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.404531</td>\n",
       "      <td>0.529017</td>\n",
       "      <td>0.648508</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-04</th>\n",
       "      <td>0.919625</td>\n",
       "      <td>1.084128</td>\n",
       "      <td>0.568731</td>\n",
       "      <td>0.648635</td>\n",
       "      <td>1.378360</td>\n",
       "      <td>0.035112</td>\n",
       "      <td>1.099022</td>\n",
       "      <td>0.152760</td>\n",
       "      <td>0.160653</td>\n",
       "      <td>0.677186</td>\n",
       "      <td>...</td>\n",
       "      <td>0.173193</td>\n",
       "      <td>0.323164</td>\n",
       "      <td>0.109620</td>\n",
       "      <td>0.279705</td>\n",
       "      <td>0.322258</td>\n",
       "      <td>0.332723</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.394384</td>\n",
       "      <td>0.528011</td>\n",
       "      <td>0.645828</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2021-11-05</th>\n",
       "      <td>0.931619</td>\n",
       "      <td>1.098780</td>\n",
       "      <td>0.556143</td>\n",
       "      <td>0.651763</td>\n",
       "      <td>1.388310</td>\n",
       "      <td>0.036101</td>\n",
       "      <td>1.099022</td>\n",
       "      <td>0.163559</td>\n",
       "      <td>0.163156</td>\n",
       "      <td>0.688279</td>\n",
       "      <td>...</td>\n",
       "      <td>0.173361</td>\n",
       "      <td>0.326286</td>\n",
       "      <td>0.109143</td>\n",
       "      <td>0.282829</td>\n",
       "      <td>0.332823</td>\n",
       "      <td>0.317723</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.384394</td>\n",
       "      <td>0.529017</td>\n",
       "      <td>0.636578</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2877 rows × 1933 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            000001.SZ  000002.SZ  000004.SZ  000005.SZ  000006.SZ  000007.SZ  \\\n",
       "trade_date                                                                     \n",
       "2010-01-04   0.259249   0.299814        NaN   0.135157   0.334258        NaN   \n",
       "2010-01-05   0.263810   0.306758        NaN   0.130579   0.344163        NaN   \n",
       "2010-01-06   0.268420   0.306758        NaN   0.133156   0.343206        NaN   \n",
       "2010-01-07   0.271378   0.309148        NaN   0.138866   0.346081        NaN   \n",
       "2010-01-08   0.271983   0.307050        NaN   0.137451   0.337895        NaN   \n",
       "...               ...        ...        ...        ...        ...        ...   \n",
       "2021-11-01   0.847529   1.076426   0.567376   0.627628   1.365001   0.039004   \n",
       "2021-11-02   0.903914   1.110001   0.582954   0.654922   1.391788   0.038585   \n",
       "2021-11-03   0.911494   1.084716   0.571102   0.648635   1.378360   0.036766   \n",
       "2021-11-04   0.919625   1.084128   0.568731   0.648635   1.378360   0.035112   \n",
       "2021-11-05   0.931619   1.098780   0.556143   0.651763   1.388310   0.036101   \n",
       "\n",
       "            000008.SZ  000009.SZ  000010.SZ  000011.SZ  ...  603989.SH  \\\n",
       "trade_date                                              ...              \n",
       "2010-01-04        NaN   0.160154   0.026386   0.114291  ...        NaN   \n",
       "2010-01-05        NaN   0.164401   0.026864   0.117950  ...        NaN   \n",
       "2010-01-06        NaN   0.164558   0.026589   0.117607  ...        NaN   \n",
       "2010-01-07        NaN   0.161496   0.027675   0.120402  ...        NaN   \n",
       "2010-01-08        NaN   0.154043   0.027192   0.119222  ...        NaN   \n",
       "...               ...        ...        ...        ...  ...        ...   \n",
       "2021-11-01   1.068719   0.146724   0.156255   0.670826  ...   0.193885   \n",
       "2021-11-02   1.083658   0.152760   0.161064   0.683667  ...   0.195271   \n",
       "2021-11-03   1.088732   0.157808   0.159834   0.679117  ...   0.190505   \n",
       "2021-11-04   1.099022   0.152760   0.160653   0.677186  ...   0.173193   \n",
       "2021-11-05   1.099022   0.163559   0.163156   0.688279  ...   0.173361   \n",
       "\n",
       "            603990.SH  603991.SH  603992.SH  603993.SH  603995.SH  603996.SH  \\\n",
       "trade_date                                                                     \n",
       "2010-01-04        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-05        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-06        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-07        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "2010-01-08        NaN        NaN        NaN        NaN        NaN        NaN   \n",
       "...               ...        ...        ...        ...        ...        ...   \n",
       "2021-11-01   0.318522   0.108844   0.282374   0.304535   0.342689        NaN   \n",
       "2021-11-02   0.327955   0.111417   0.283728   0.312881   0.342618        NaN   \n",
       "2021-11-03   0.327279   0.111079   0.278823   0.309693   0.340483        NaN   \n",
       "2021-11-04   0.323164   0.109620   0.279705   0.322258   0.332723        NaN   \n",
       "2021-11-05   0.326286   0.109143   0.282829   0.332823   0.317723        NaN   \n",
       "\n",
       "            603997.SH  603998.SH  603999.SH  \n",
       "trade_date                                   \n",
       "2010-01-04        NaN        NaN        NaN  \n",
       "2010-01-05        NaN        NaN        NaN  \n",
       "2010-01-06        NaN        NaN        NaN  \n",
       "2010-01-07        NaN        NaN        NaN  \n",
       "2010-01-08        NaN        NaN        NaN  \n",
       "...               ...        ...        ...  \n",
       "2021-11-01   0.398073   0.527009   0.641807  \n",
       "2021-11-02   0.404907   0.532085   0.655308  \n",
       "2021-11-03   0.404531   0.529017   0.648508  \n",
       "2021-11-04   0.394384   0.528011   0.645828  \n",
       "2021-11-05   0.384394   0.529017   0.636578  \n",
       "\n",
       "[2877 rows x 1933 columns]"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fac"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "1ad71025",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "trade_date\n",
       "2010-01-04         NaN\n",
       "2010-01-05         NaN\n",
       "2010-01-06         NaN\n",
       "2010-01-07         NaN\n",
       "2010-01-08         NaN\n",
       "                ...   \n",
       "2021-11-02    0.406567\n",
       "2021-11-03    0.406598\n",
       "2021-11-04    0.406612\n",
       "2021-11-05    0.406818\n",
       "2021-11-08    0.406801\n",
       "Length: 2878, dtype: float64"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7a8f6f6b",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
